package sg.edu.nus.iss.vmcs.store;

/*
 * Copyright 2011 ISS.
 * The contents contained in this document may not be reproduced in any
 * form or by any means, without the written permission of ISS, other
 * than for the purpose for which it has been supplied.
 *
 */

/**
 * This object stores the weight and value of each type of Coin, and hence 
 * enables the machine to recognize each Coin entered. This class inherits from
 * the StoreObject.
 * @version 1.0  07/12/2011
 * @author Team 7S - SE19
 */

public class Coin extends StoreObject {

    private int value;
    private double weight;

/**
 * This constructor creates an instance of the Coin object.  
 */
    public Coin () {
    }
    
/**
 * Constructs a new Coin object that has a specified denomination and weight.
 * For instance, a 50-cent coin with a 5.67gram weight will be initialized 
 * when the value 50, weight 5.67 is passed to this constructor.
 * @param value the integer value of the denomination of the Coin object.  For 
 * instance, a 50-cent coin will be set to an integer value of 50.
 * @param weight the weight of a particular Coin denomination.  For instance, a 
 * 50-cent coin that has a weight of 5.67grams will be set to 5.67.
 */
    public Coin (int value, double weight) {
        this.value = value;
        this.weight = weight;
    }

/**
 * Set the denomination (value) of the Coin object.
 * @param v the integer value of the denomination of the Coin object.  For 
 * instance, a 50-cent coin will be set to an integer value of 50.
 */
    public void setValue(int v){
      value = v;
    }

/**
 * Set the weight, in grams, of the Coin object of a particular denomination.
 * @param wt the weight of a particular Coin denomination.  For instance, a 
 * 50-cent coin that has a weight of 5.67grams will be set to 5.67.
 */
    public void setWeight(double wt){
      weight = wt;
    }

/**
 * Gets the weight, in grams, of the Coin object of a particular denomination.
 * @return returns the weight, in grams, of the Coin of a particular 
 * denomination.
 */
    public double getWeight () {
        return (weight);
    }

/**
 * Gets the denomination value of a particular Coin type.  
 * @return returns an integer of the denomination of a particular Coin type.
 */
    public int getValue () {
        return (value);
    }

  }
